package com.mvpandroiddemo;

import android.app.Application;

import androidx.annotation.Nullable;

import com.mvpandroiddemo.net.APIHelper;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;


public class MvpApplication extends Application {

    private static MvpApplication mvpApplication;

    @Override
    public void onCreate() {
        super.onCreate();

        Logger.addLogAdapter(new AndroidLogAdapter() {
            @Override
            public boolean isLoggable(int priority, @Nullable String tag) {
                return true;
            }
        });

        APIHelper.getInstance().init();
        if (mvpApplication == null) {
            mvpApplication = this;
        }
    }

    public static MvpApplication getInstance() {
        return mvpApplication;
    }
}
